﻿Public Class EventoNegocio

    Public Function insertar(ByVal idproveedor As Integer, ByVal iddeporte As Integer, ByVal ubicacion As String, ByVal descripcion As String, ByVal fecha_evento As String) As Evento

        Dim modelo As New Evento()

        modelo.idproveedor = idproveedor
        modelo.iddeporte = iddeporte
        modelo.ubicacion = ubicacion
        modelo.descripcion = descripcion
        modelo.fecha_evento = fecha_evento


        Dim dao As New EventoDAO
        Return dao.insertar(modelo)
    End Function

    Public Function listar() As Collection
        Dim dao As New EventoDAO
        Return dao.listar()
    End Function


    Public Function buscarPorFecha_evento(ByVal fecha_evento As String) As Collection
        Dim dao As New EventoDAO
        Return dao.buscarPorFecha_evento(fecha_evento)
    End Function


    Public Function obtener(ByVal idevento As Integer) As Evento
        Dim dao As New EventoDAO
        Return dao.obtener(idevento)
    End Function

    Public Sub eliminar(ByVal idevento As Integer)
        Dim dao As New EventoDAO
        dao.eliminar(idevento)
    End Sub

    Public Sub actualizar(ByVal idevento As Integer, ByVal idproveedor As Integer, ByVal iddeporte As String, ByVal ubicacion As String, ByVal descripcion As String, ByVal fecha_evento As String)

        Dim modelo As New Evento()
        modelo.idevento = idevento
        modelo.idproveedor = idproveedor
        modelo.iddeporte = iddeporte
        modelo.ubicacion = ubicacion
        modelo.descripcion = descripcion
        modelo.fecha_evento = fecha_evento

        Dim dao As New EventoDAO
        dao.actualizar(modelo)
    End Sub

End Class
